//
//  ZYCAttendanceEvaluateHeaderView.m
//  ZDSC
//
//  Created by ZDTX on 2021/9/3.
//

#import "ZYCAttendanceEvaluateHeaderView.h"
#import "ZYCTeachingAttendanceEvaluationModel.h"
@interface ZYCAttendanceEvaluateHeaderView ()

@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *scoreLabel;
@end
@implementation ZYCAttendanceEvaluateHeaderView

- (void)setTotal:(NSString *)total{
    _total = total;
    _titleLabel.text = [NSString stringWithFormat:@"参与评价: %@人",total];
}
- (void)setAvgScore:(NSString *)avgScore{
    _avgScore = avgScore;
    _scoreLabel.text = [NSString stringWithFormat:@"均分: %.2f分",[avgScore floatValue]];

}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = HEX_RGB(@"FFFFFF");
        [self addSubview:self.titleLabel];
        [self addSubview:self.scoreLabel];
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(19.0f);
            make.centerY.equalTo(self);
        }];

        [self.scoreLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self).offset(-19.0f);
            make.centerY.equalTo(self);
        }];
    }
    return self;
}


- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [UILabel LabelWithFont:kSystemBoldFont(17.0f) titleColor:HEX_RGB(@"#262A28") textAlignment:ZZTextAlignmentLeft];
    }
    return _titleLabel;
}

- (UILabel *)scoreLabel {
    if (!_scoreLabel) {
        _scoreLabel = [UILabel LabelWithFont:kSystemBoldFont(17.0f) titleColor:HEX_RGB(@"#E93C06") textAlignment:ZZTextAlignmentRight];
    }
    return _scoreLabel;
}
@end
